<template>
  <div class='articl-item'>
    <!-- 单元格 -->
    <van-cell :to="'/arctcle/'+article.art_id" :title="article.title">
      <div slot='label' class='custom-label'>
        <div v-if='article.cover.type === 3' class='cover-images'>
          <van-image v-for='(item,index) in article.cover.images' :key='index' fit="cover" :src="item" />
        </div>
        <span>{{article.aut_name}}</span>
        <span class='common'>{{article.comm_count}}评论</span>
        <span>{{article.pubdate | formatDate}}</span>
      </div>
      <van-image v-if='article.cover.type === 1' class='right-image' fit="contain" :src="article.cover.images[0]" />
    </van-cell>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  props: {
    // 父传子的文章项列表
    article: {
      type: Object,
      required: true
    }
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () {

  },
  mounted () { }
}
</script>

<style scoped lang='less'>
.articl-item {
  .van-cell__title,
  .van-cell__value {
    flex: unset;
  }
  .custom-label {
    color: #999;
    font-size: 23px;
    .common {
      margin: 0 10px;
    }
    .cover-images {
      display: flex;
      margin: 30px 0;
      .van-image {
        width: 232px;
        height: 146px;
      }
      .van-image:nth-child(2) {
        margin: 0 4px;
      }
    }
  }
  .right-image {
    width: 250px;
    height: 150px;
  }
}
</style>
